package com.zfast.yugioh.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zfast.forge.common.BaseService;
import com.zfast.forge.common.Page;
import com.zfast.yugioh.model.Card;
import com.zfast.yugioh.mapper.CardMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 卡牌
 *
 * @author zgn
 * @email 
 * @date 2022-06-08 16:56:12
 */
@Service("cardService")
public class CardService extends BaseService<Integer, Card> {
    public CardService(CardMapper mapper) {
        super(mapper);
    }

    @Resource
    CardMapper cardMapper;

    public PageInfo<Card> pageList(Page<Card> page) {
        PageHelper.startPage(page.getNum(), page.getSize());
        List<Card> list = cardMapper.selectLikeCard(page.getData());
        PageInfo<Card> pageInfo = new PageInfo(list);
        return pageInfo;
    }
}

